var i=0;

var galleries = new Array();

	galleries[0] = "<img class='gallery' alt='gal1' src='images/gal1.jpg'>";

	galleries[1] = "<img class='gallery' alt='gal2' src='images/gal2.jpg'>";

	galleries[2] = "<img class='gallery' alt='gal3' src='images/gal3.jpg'>";

	galleries[3] = "<img class='gallery' alt='gal4' src='images/gal4.jpg'>";

	galleries[4] = "<img class='gallery' alt='gal5' src='images/gal5.jpg'>";
 
    galleries[5] = "<img class='gallery' alt='gal5' src='images/gal6.jpg'>";




function galleryrun(){


    document.getElementById("gallerymain").innerHTML = galleries[i];

    
document.getElementById("gallery"+(i+1)).style.borderColor="green";

	
if(document.getElementById("gallery1").style.borderColor=="green" && document.getElementById("gallery6").style.borderColor=="red")
		

document.getElementById("gallery6").style.borderColor="black";


	
	try{
	document.getElementById("gallery"+(i)).style.borderColor="black";


	}catch(exception){
}
    
    

i = (i==5) ? 0 : i+1;
    

setTimeout("galleryrun()",5000);    



	}